package com.zhang.authoritycenter.dao.auth;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhang.authoritycenter.common.model.dao.auth.UserBaseDO;
import com.zhang.authoritycenter.common.model.dto.organization.OrganizationQueryReqDTO;
import com.zhang.authoritycenter.common.model.vo.organization.GetUserVO;
import com.zhang.authoritycenter.common.model.vo.organization.OrganizationUserQueryVO;
import com.zhang.authoritycenter.common.model.dto.authority.AuthByUserDTO;
import com.zhang.infrastructure.api.authority.UserRemoteVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 用户信息表 Mapper 接口
 * </p>
 *
 * @author KingHood
 * @since 2023-12-13
 */
public interface UserBaseMapper extends BaseMapper<UserBaseDO> {

    /**
     * 用户分页
     *
     * @param page 分页
     * @param in 筛选条件
     * @return 用户
     * @author zfj
     * @date 2023/12/18
     */
    Page<OrganizationUserQueryVO> queryPage(Page<Object> page, @Param("data") OrganizationQueryReqDTO in);

    /**
     * 获取账号的权限
     *
     * @param userId 账号id
     * @return 权限
     * @author zfj
     * @date 2023/12/22
     */
    AuthByUserDTO getAuth(@Param("userId") Long userId);

    /**
     * 获取用户信息
     *
     * @param userId 用户id
     * @return 用户信息
     * @author zfj
     * @date 2024/1/2
     */
    GetUserVO getUser(@Param("userId") Long userId);

    /**
     * 按ID获取用户
     *
     * @param ids ids
     * @author jp
     * @date 2024/01/04
     */
    List<UserRemoteVo> getUserByIds(@Param("ids") List<Long> ids);

    /**
     * 按姓名或帐户获取id列表
     *
     * @param key 钥匙
     * @return @return {@link List }<{@link Long }>
     * @author jp
     * @date 2024/01/10 17:17
     */
    List<Long> getIdListByNameOrAccount(String key);

    /**
     * 用户菜单列表
     *
     * @param userId 用户id
     * @return @return {@link List }<{@link String }>
     * @author jp
     * @date 2024/01/15 14:11
     */
    List<String> userMenuList(Long userId);
}
